

public class SorteerAlgoritmen {
	InsertionSort insertionSort;
	MergeSort mergeSort;
	QuickSort quickSort;
	

	
	public SorteerAlgoritmen( ){
		insertionSort = new InsertionSort();
		mergeSort = new MergeSort();
		quickSort = new QuickSort();
	}
	
	public <T extends Comparable<? super T >> T[] insertionSort(T[] list){
		long before = System.nanoTime();
		T[] tmpList = insertionSort.sort(list);
		long after = System.nanoTime();
		long runTime = after-before;
		int steps = insertionSort.getSteps();
		
		System.out.println("InsertionSort: runtime: " + (long)runTime/1000000000.0 + " seconds. Amount of elements: " +tmpList.length + " steps taken: " + steps );		
		return tmpList;
	}
	
	public <T extends Comparable<? super T >> T[] quickSort(T[] list){
		long before = System.nanoTime();
		T[] tmpList = quickSort.sort(list);
		long runTime = System.nanoTime()-before;
		int steps = quickSort.getSteps();
		
		System.out.println("Quick sort: runtime: " + (long)runTime/1000000000.0 + " seconds. Amount of elements: " +tmpList.length + " steps taken: " + steps );		
		return tmpList;
	}
	
	public <T extends Comparable<? super T >> T[] mergeSort(T[] list){
		long before = System.nanoTime();
		T[] tmpList = mergeSort.mergeSort(list);
		long runTime = System.nanoTime()-before;
		int steps = mergeSort.getSteps();
		
		System.out.println("Merge Sort: runtime: " + (long)runTime/1000000000.0 + " seconds. Amount of elements: " +tmpList.length + " steps taken: " + steps );			
		return tmpList;
		
	}
	
	

}
